package com.xgx.startegy.service.impl;

import com.xgx.startegy.handler.AbstractHandler;
import com.xgx.startegy.handler.HandlerContext;
import com.xgx.startegy.model.OrderDto;
import com.xgx.startegy.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;

public class IOrderServiceImplV2 implements IOrderService {

    @Autowired
    private HandlerContext handlerContext;

    @Override
    public String handle(OrderDto orderDto) {
        AbstractHandler instance = handlerContext.getInstance(orderDto.getType());
        return instance.handle(orderDto);
    }
}
